<template>
	<el-col :span="options.span || 22" class="input">
		<el-form-item :required="options.required" v-if="showItem" :label="options.label" :prop="options.prop">
			<el-input @keyup.enter.native="enter" v-on="$listeners" v-bind="$attrs" :rows="options.rows" :placeholder="options.placeholder || '请输入'" :disabled="options.disabled"
				:clearable="options.clearable" show-word-limit :maxlength="options.maxlength" :type="options.type"
				v-model="inputVal">
			</el-input>
			<div v-if="options.tip" class=" xc-c-666 xc-text-12">
				* {{options.tip}}
			</div>
		</el-form-item>
	</el-col>
</template>

<script>
	export default {
		props: {
			value: [String, Number],
			options: {
				type: Object,
				dfault() {
					return {
						span:22
					}
				}
			},
		},
		computed: {
			inputVal: {
				get: function() {
					return this.value;
				},
				set: function(e) {
					this.$emit("input", e);
				},
			},
			showItem() {
				if (this.options.show) return this.options.show(this.vm)
				return true;
			}
		},
		inject: ['vm'],
		mounted(){
			// console.log('vm',this.vm);
		},
		methods: {
			enter(){
				if(this.vm && this.vm.search){
					this.vm.search();
				}
			},
			// showItem() {
			// 	console.log('show', show(this.vm));
			// },
		},
	};
</script>
<style scoped>
	/* .input>>>.el-form-item--mini .el-form-item__content,
	.el-form-item--mini .el-form-item__label {
		max-height: 30px;
	} */
</style>
<style>
</style>